import org.junit.Test;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

public class demo {

    @Test
    public void test(){
        HttpHeaders headers = new HttpHeaders();
        headers.add("Authorization","bearer 0659179c-1e36-49d5-a12a-d8f34014356a");
        RestTemplate restTemplate = new RestTemplate();
        HttpEntity requestEntity = new HttpEntity<>(headers);
        ResponseEntity<Resource> request = restTemplate.exchange("http://127.0.0.1:7081/user/id?userId=1", HttpMethod.GET, requestEntity, Resource.class);
        System.out.println(request.getBody());
    }

}
